(0, require("../../../@babel/runtime/helpers/interopRequireDefault").default)(require("../../../utils/util"));
var t = new(require("../../../utils/http").HTTP);
Page({
  data: {
    taga: [{
      id: 0,
      name: "全年"
    }, {
      id: 1,
      name: "1月"
    }, {
      id: 2,
      name: "2月"
    }, {
      id: 3,
      name: "3月"
    }, {
      id: 4,
      name: "4月"
    }, {
      id: 5,
      name: "5月"
    }, {
      id: 6,
      name: "6月"
    }, {
      id: 7,
      name: "7月"
    }, {
      id: 8,
      name: "8月"
    }, {
      id: 9,
      name: "9月"
    }, {
      id: 10,
      name: "10月"
    }, {
      id: 11,
      name: "11月"
    }, {
      id: 12,
      name: "12月"
    }],
    currentItem: 0,
    show: !0
  },
  onLoad: function () {
    var a = wx.getStorageSync("user"),
      e = this;
    e.setData({
        user: a
      }),
      t.request({
        url: "https://www.qlsyyun.com:3030/rent/list",
        data: {
          arr: 7,
          zsy: a[0]
        }
      }).then((function (s) {
        e.setData({
            hire: s.data
          }),
          t.request({
            url: "https://www.qlsyyun.com:3030/rent/list",
            data: {
              arr: 8,
              zsy: a[0]
            }
          }).then((function (t) {
            e.setData({
              list: t.data
            })
          })),
          t.request({
            url: "https://www.qlsyyun.com:3030/rent/list",
            data: {
              arr: 9,
              zsy: a[0]
            }
          }).then((function (t) {
            null == t.data[0].mj ? e.setData({
              total: 0
            }) : e.setData({
              total: t.data[0].mj
            })
          }))
      }))
  },
  tagChoose: function (a) {
    var e = this,
      s = a.currentTarget.dataset.id;
    0 == s ? (e.setData({
      currentItem: s,
      show: !0
    }), t.request({
      url: "https://www.qlsyyun.com:3030/rent/list",
      data: {
        arr: 7,
        zsy: e.data.user[0]
      }
    }).then((function (a) {
      e.setData({
          hire: a.data
        }),
        t.request({
          url: "https://www.qlsyyun.com:3030/rent/list",
          data: {
            arr: 8,
            zsy: e.data.user[0]
          }
        }).then((function (t) {
          e.setData({
            list: t.data
          })
        })),
        t.request({
          url: "https://www.qlsyyun.com:3030/rent/list",
          data: {
            arr: 9,
            zsy: e.data.user[0]
          }
        }).then((function (t) {
          0 == t.data.length || null == t.data[0].mj ? e.setData({
            total: 0
          }) : e.setData({
            total: t.data[0].mj
          })
        }))
    }))) : (e.setData({
      currentItem: s,
      show: !1
    }), t.request({
      url: "https://www.qlsyyun.com:3030/rent/list",
      data: {
        arr: 5,
        month: s,
        zsy: e.data.user[0]
      }
    }).then((function (a) {
      e.setData({
          hire: a.data
        }),
        t.request({
          url: "https://www.qlsyyun.com:3030/rent/list",
          data: {
            arr: 6,
            month: s,
            zsy: e.data.user[0]
          }
        }).then((function (t) {
          e.setData({
            list: t.data
          })
        }))
    })))
  }
});